package open3366pvp.as3.dataStruct
{
	import flash.utils.ByteArray;
	
	import open3366pvp.as3.Open3366PvpEvent;
	
	/**
	 * 获取批量用户信息
	 * @author mandyxiong
	 * 
	 */	
	public class MassUserProp implements IPvpInfo
	{
		public var gameId:uint;
		public var uid:String;
		public var zoneId:int;
		public var userNum:int;
		public var userList:Array;
		
		public function parasData(data:ByteArray):void
		{
			uid = data.readUTFBytes(32);
			gameId = data.readUnsignedInt();
			zoneId = data.readInt();
			userNum = data.readInt();
			userList = [];
			for (var i:int = 0; i < userNum; i++ )
			{
				userList.push(new UserInfo(data));
			}
		}
		
		public function get eventType():String
		{
			return Open3366PvpEvent.GET_MASS_USER_INFO;
		}
		
		public function toString():String
		{
			var str:String = "uid :" + uid + ", gameId" + gameId + ", zoneId" + zoneId + "\n";
			var len:int = userList.length;
			for(var i:int = 0; i < len; i++)
			{
				str += ("uid:" + userList[i].uid +  ", nick:" + userList[i].nick + ", bufferContent:" +userList[i].bufferData.toString()+";\n");
			}
			return "获取批量用户成功！！\n" + str;
		}
	}
}